#pragma once

#include "Event.h"
//#include "Core/Input.h"
#include "Core/KeyCodes.h"
/*
 * Event类独立写为一个类。是在windowsWindow初始化的时候，根据GLFW的时间类型比如点击，比如按键。比如关闭，发生回调
 * 发生回调的时候，在是在windowsWindow new一个相关的event然后传入WindowsWindow->EventCallback
 * */
namespace Hazel{
    class KeyEvent : public Event{
    public:
        inline KeyCode GetKeyCode() const {return m_keyCode;}
        EVENT_CLASS_CATEGORY(EventCategoryKeyboard | EventCategoryInput)
    protected:
        KeyEvent(KeyCode keycode):m_keyCode(keycode){}

        KeyCode m_keyCode;
    };


    class KeyPressedEvent : public KeyEvent{
    public:
        KeyPressedEvent(KeyCode keycodes, int repeatCount) : KeyEvent(keycodes),m_RepeatCount(repeatCount){}

        inline int GetRrepeatCount() const {return m_RepeatCount;}
        std::string ToString() const override {
            std::stringstream ss;
            ss<<"keypressedevent:"<<m_keyCode;
            return ss.str();
        }

        EVENT_CLASS_TYPE(KeyPressed)

    private:
        int m_RepeatCount;
    };


    class KeyReleasedEvent : public KeyEvent{
    public:
        KeyReleasedEvent(KeyCode keycode) : KeyEvent(keycode){}
        std::string ToString() const override{
            std::stringstream ss;
            ss<<"keyreeve"<< m_keyCode;
            return ss.str();
        }

        EVENT_CLASS_TYPE(KeyReleased)
    };
    class KeyTypedEvent : public KeyEvent
    {
    public:
        KeyTypedEvent(KeyCode keycode)
                : KeyEvent(keycode) {}

        std::string ToString() const override
        {
            std::stringstream ss;
            ss << "KeyTypedEvent: " << m_keyCode;
            return ss.str();
        }

        EVENT_CLASS_TYPE(KeyTyped)
    };
}



















